package de.bazinga.rotw.objects;

import com.jme.bounding.BoundingBox;
import com.jme.math.Vector3f;
import com.jme.scene.Node;
import com.jme.scene.shape.Box;

import de.bazinga.rotw.person.Person;
import de.bazinga.rotw.player.Player;
import de.bazinga.rotw.texture.TextureCache;

public class JumpStation extends Node implements GameObject {
	private static final long serialVersionUID = 1L;

	public JumpStation(Vector3f start, Vector3f end) {
		
		Box jumper = new Box("jumper",
				start,
				end);
		
		jumper.setRenderState(TextureCache.getInstance().getTexture("texture/jumpStation.jpg"));
		jumper.updateRenderState();
		
		jumper.setModelBound(new BoundingBox());
		jumper.updateModelBound();
		
		this.attachChild(jumper);
	}
	
	public void onCollision(Person person, boolean sendMessage) {
		if(person instanceof Player) {
			Player player = (Player)person;
			
			if(player.getPlayerActions() != null) {
				player.getPlayerActions().jump(20f);
			}
		}
	}


	
	public void hide() {
		
	}
	
	public boolean respawn() {
		// Do Nothing, since we dont hide it
		return true;
	}
}
